package findjob;

/**
 * @author lidexin
 * @create 2021-10-10 22:02
 */
//阶乘求和1！+2！...+20!
public class Test1 {
    public static long sum() {
        long sum = 0; //阶乘的和
        long temp = 1; //每一个阶乘的值
        for (int i = 1; i <= 20; i++) {
            temp *= i;
            sum += temp;
        }
        return sum;
    }

    public static void main(String[] args) {
        long sum = sum();
        System.out.println(sum);
    }
}
